﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="uscProduct.ascx.cs"
    Inherits="KCL.Components.uscProduct" %>
<style type="text/css">
    .style1
    {
        width: 170px;
    }
</style>
<table style="width: 930px;">
    <tr>
        <td class="style1">
            Mã sản phẩm mới</td>
        <td>
            <asp:Label ID="lblProductCode" runat="server" Font-Bold="True"></asp:Label>
        </td>
        <td>
            Tên sản phẩm
        </td>
        <td>
            <asp:TextBox ID="txtProductName" runat="server"></asp:TextBox>
        </td>
        <td align="right" width="100">
            <asp:Button ID="btnAddProduct" runat="server" OnClick="btnAddProduct_Click" Text="Thêm"
                Width="70px" />
        </td>
    </tr>
</table>
<asp:GridView ID="dgvProduct" runat="server" AutoGenerateColumns="False" BackColor="White"
    BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="id"
    DataSourceID="srcProduct" EnableModelValidation="True" ForeColor="Black" GridLines="Vertical"
    AllowPaging="True" Width="930px">
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:BoundField DataField="code" HeaderText="Mã sản phẩm" ReadOnly="True" />
        <asp:BoundField DataField="name" HeaderText="Tên sản phẩm" />
        <asp:CommandField ShowEditButton="True" CancelText="Đóng" EditText="Sửa" UpdateText="Lưu" />
        <asp:TemplateField ShowHeader="False">
            <ItemTemplate>
                <asp:LinkButton Style="color: Black" ID="LinkButton1" runat="server" CausesValidation="False"
                    CommandName="Delete" Text="Xóa" OnClientClick="javascript:return confirm('Bạn có chắc muốn xóa dòng này?');"></asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="#CCCC99" />
    <HeaderStyle BackColor="#FFFFCC" Font-Bold="True" ForeColor="#CC0000" />
    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
    <RowStyle BackColor="#F7F7DE" />
    <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
</asp:GridView>
<asp:ObjectDataSource ID="srcProduct" runat="server" DataObjectTypeName="KCL.Code.Product"
    DeleteMethod="Delete" InsertMethod="Insert" SelectMethod="GetAllProducts" TypeName="KCL.Code.Business.ProductServices"
    UpdateMethod="Update"></asp:ObjectDataSource>
